﻿namespace SoEasyPlatform.Code.Util
{
    public class JsonUtil
    {
        public static string ToJson<T>(T obj, bool indented = false)
        {
            if (indented)
            {
                return Newtonsoft.Json.JsonConvert.SerializeObject(obj, Newtonsoft.Json.Formatting.Indented);
            }
            return Newtonsoft.Json.JsonConvert.SerializeObject(obj);
        }
    }
}
